#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;

struct kind{
    double amount;
    double price;
    double per;
};
bool cmp(kind a,kind b){
    return a.per>b.per;
}
int main(){
    //freopen("in.txt","r",stdin);
    int N,D;
    scanf("%d %d",&N,&D);
    kind cake[N];
    for(int i=0;i<N;i++){scanf("%lf",&cake[i].amount);}
    for(int i=0;i<N;i++){
            scanf("%lf",&cake[i].price);
            cake[i].per=cake[i].price*1.0/cake[i].amount;
    }
    sort(cake,cake+N,cmp);
    double profit=0;
    int i=0;
    while(D>0){
        if(D>=cake[i].amount){
            profit+=cake[i].price;
            D-=cake[i].amount;
        }
        else{
            profit+=D*cake[i].per;
            break;
        }
        i++;
    }
    printf("%.2lf\n",round(profit*100)/100);


}

